/**
 * 拆分单元格设置
 */
function scSplitCellSetting() {
    var com = scCommon.instance();
    var crEle = com.crEle;
    var box = null;

    this.createView = function (option) {
        option = option ? option : {};
        box = crEle(null, "sc-splitcell-setting");

        var list = [
            { label: "行数", name: "rowCount", value: 1, unit: "行", minNum: 1, maxNum: 10 },
            { label: "列数", name: "columnCount", value: 1, unit: "列", minNum: 1, maxNum: 20 }
        ];

        var row = null;
        var item = null;
        for (var i in list) {
            item = list[i];

            row = crEle(null, "sc-setting-row");

            let label = crEle("label", "sc-setting-label");
            let number = new scNumber();

            let param = {
                name: item.name,
                value: item.value,
                unit: item.unit,
                minNum: item.minNum,
                maxNum: item.maxNum
            };
            let input = null;

            input = number.createView(param);
            label.innerText = item.label + "：";

            row.appendChild(label);
            row.appendChild(input);
            box.appendChild(row);
        }

        return box;
    }

    this.getData = function () {
        return new Promise((resolve)=>{
            com.getData(box).then((data)=>{
                let result = {};

                result.$option = {};
                result.$option.beforeSubmit = ()=>{
                    return data;
                };
    
                resolve(result);
            });
        })
    }
}